<#assign StringUtils = beansWrapperFn.getStaticModels()["org.apache.commons.lang3.StringUtils"]>
SELECT COUNT(1) FROM c1_role t
WHERE 1 = 1
<#if StringUtils.isBlank(orgId)>
    <#if !isAdmin>
    AND 1 = 2
    </#if>
<#else>
AND T.ORG_ID = :orgId
</#if>
<#if StringUtils.isNotBlank(code)>
AND (T.`CODE` LIKE concat('%',:code ,'%') OR T.`NAME` LIKE concat('%',:code ,'%'))
</#if>
